
<?php
/*
Single Post Template: Post - Newsletter
*/
?>

<?php
	global $postid; 
	$postid = get_the_ID();
?>

<?php include 'lp-header.php' ; ?>

<style>
	#content h3.newsletterH3 { display:block;width:100%;height:30px;line-height:30px;text-indent:10px;font-size:18px;font-weight:bold;color:#ffffff;background:#e77d1d;margin:0px;margin-bottom:10px; }
	#content h2.newsletterH2 { display:block;width:100%;height:40px;line-height:40px;text-indent:10px;font-size:20px;font-weight:bold;color:#ffffff;background:#002d55;margin:0px; }
	.newsletterImage { width:204px;float:left;margin:0px;margin-right:20px; }
	.newsletterContent { width:436px;float:left;margin:0px; }
	#sidebar {  }
		#sidebar-container h3.newsletterH3 { display:block;width:100%;height:30px;line-height:30px;text-indent:10px;font-size:18px;font-weight:bold;color:#ffffff;background:#e77d1d;margin:0px; }
		.newslettersidebarbox { width:278px;padding:10px;border:#e77d1d 1px solid;border-top:0px;margin-bottom:10px;background:#f2f2f2; }
			.newslettersidebarbox h3.newsletterH3 { display:block;width:100%;height:30px;line-height:30px;text-indent:10px;font-size:18px;font-weight:bold;color:#ffffff;background:#e77d1d;margin:0px; }
			.newslettersidebarbox ul { list-style:none;padding:0px;margin:0px; }
				.newslettersidebarbox ul li { display:block;height:22px;line-height:22px;margin:0px;font-size:12px; }
					.newslettersidebarbox ul li a, .newslettersidebarbox ul li a:visited { color:#002d55;text-decoration:none; }
						.newslettersidebarbox ul li a:hover { color:#e77d1d; }
			.newslettersidebarbox textarea { width:97%; }
			.newslettersidebarbox input[type=text] { height:26px;line-height:26px;text-indent:10px; }
			.newslettersidebarbox input[type=submit] { display:block;width:100%;height:40px;line-height:38px;background:#002d55;color:#ffffff;text-align:center;font-size:15px;font-weight:bold; }
				.newslettersidebarbox input[type=submit]:hover { background:#e77d1d; }
</style>

	<div id="container">
    
		<div id="content" class="newsletter-content">

		<?php the_post() ?>

			<div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>">
				<h2 class="newsletterH2">SunMaxx Dealer Newsletter | <?php meta('NLMonth'); ?> <?php meta('NLDay'); ?>, <?php meta('NLYear'); ?></h2>
                <?php // include ('socialbuttons.php'); ?>
				<div class="entry-content">
                
                	<!-- Begin Newsletter Content Section -->
                    
			<?php if(has_sub_field('NLSection')) { ?>

				<h3 class="newsletterH3"><?php the_sub_field('NLSectionTitle'); ?></h3>
				<div class="newsletterImage">
					<?php if(get_sub_field('NLSectionImage')) { ?>
                        			<img src="<?php the_sub_field('NLSectionImage'); ?>" alt="<?php the_sub_field('NLSectionTitle'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
					<?php } else { ?>
						<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php the_sub_field('NLSectionTitle'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
					<? } ?>
				</div>
				<div class="newsletterContent">
					<?php the_sub_field('NLSectionContent'); ?>
				</div>
				<div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>

			<?php } else { ?>

                    <!-- NEWSLETTER SECTION 1 IF AVAILABLE -->
					<?php if ( get_post_meta($post->ID, 'NLSection1Title', true) ) { ?>
                        <h3 class="newsletterH3"><?php meta('NLSection1Title'); ?></h3>
                        <div class="newsletterImage">
                        	<?php if(get_post_meta($post->ID, "NLSection1Image", true)) { ?>
                        		<img src="<?php meta('NLSection1Image'); ?>" alt="<?php meta('NLSection1Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<?php } else { ?>
								<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php meta('NLSection1Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<? } ?>
                        </div>
                        <div class="newsletterContent">
                        	<?php meta('NLSection1Content'); ?>
                        </div>
                        <div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>
					<?php } ?>
                    
                    <!-- NEWSLETTER SECTION 2 IF AVAILABLE -->
					<?php if ( get_post_meta($post->ID, 'NLSection2Title', true) ) { ?>
                        <h3 class="newsletterH3"><?php meta('NLSection2Title'); ?></h3>
                        <div class="newsletterImage">
                        	<?php if(get_post_meta($post->ID, "NLSection2Image", true)) { ?>
                        		<img src="<?php meta('NLSection2Image'); ?>" alt="<?php meta('NLSection2Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<?php } else { ?>
								<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php meta('NLSection2Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<? } ?>
                        </div>
                        <div class="newsletterContent">
                        	<?php meta('NLSection2Content'); ?>
                        </div>
                        <div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>
					<?php } ?>
                    
                    <!-- NEWSLETTER SECTION 3 IF AVAILABLE -->
					<?php if ( get_post_meta($post->ID, 'NLSection3Title', true) ) { ?>
                        <h3 class="newsletterH3"><?php meta('NLSection3Title'); ?></h3>
                        <div class="newsletterImage">
                        	<?php if(get_post_meta($post->ID, "NLSection3Image", true)) { ?>
                        		<img src="<?php meta('NLSection3Image'); ?>" alt="<?php meta('NLSection3Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<?php } else { ?>
								<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php meta('NLSection3Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<? } ?>
                        </div>
                        <div class="newsletterContent">
                        	<?php meta('NLSection3Content'); ?>
                        </div>
                        <div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>
					<?php } ?>
                    
                    <!-- NEWSLETTER SECTION 4 IF AVAILABLE -->
					<?php if ( get_post_meta($post->ID, 'NLSection4Title', true) ) { ?>
                        <h3 class="newsletterH3"><?php meta('NLSection4Title'); ?></h3>
                        <div class="newsletterimage">
                        	<?php if(get_post_meta($post->ID, "NLSection4Image", true)) { ?>
                        		<img src="<?php meta('NLSection4Image'); ?>" alt="<?php meta('NLSection4Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<?php } else { ?>
								<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php meta('NLSection4Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<? } ?>
                        </div>
                        <div class="newsletterContent">
                        	<?php meta('NLSection4Content'); ?>
                        </div>
                        <div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>
					<?php } ?>
                    
                    <!-- NEWSLETTER SECTION 5 IF AVAILABLE -->
					<?php if ( get_post_meta($post->ID, 'NLSection5Title', true) ) { ?>
                        <h3 class="newsletterH3"><?php meta('NLSection5Title'); ?></h3>
                        <div class="newsletterImage">
                        	<?php if(get_post_meta($post->ID, "NLSection5Image", true)) { ?>
                        		<img src="<?php meta('NLSection5Image'); ?>" alt="<?php meta('NLSection5Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<?php } else { ?>
								<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php meta('NLSection5Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<? } ?>
                        </div>
                        <div class="newsletterContent">
                        	<?php meta('NLSection5Content'); ?>
                        </div>
                        <div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>
					<?php } ?>
                    
                    <!-- NEWSLETTER SECTION 6 IF AVAILABLE -->
					<?php if ( get_post_meta($post->ID, 'NLSection6Title', true) ) { ?>
                        <h3 class="newsletterH3"><?php meta('NLSection6Title'); ?></h3>
                        <div class="newsletterImage">
                        	<?php if(get_post_meta($post->ID, "NLSection6Image", true)) { ?>
                        		<img src="<?php meta('NLSection6Image'); ?>" alt="<?php meta('NLSection6Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<?php } else { ?>
								<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php meta('NLSection6Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<? } ?>
                        </div>
                        <div class="newsletterContent">
                        	<?php meta('NLSection6Content'); ?>
                        </div>
                        <div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>
					<?php } ?>
                    
                    <!-- NEWSLETTER SECTION 7 IF AVAILABLE -->
					<?php if ( get_post_meta($post->ID, 'NLSection7Title', true) ) { ?>
                        <h3 class="newsletterH3"><?php meta('NLSection7Title'); ?></h3>
                        <div class="newsletterImage">
                        	<?php if(get_post_meta($post->ID, "NLSection7Image", true)) { ?>
                        		<img src="<?php meta('NLSection7Image'); ?>" alt="<?php meta('NLSection7Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<?php } else { ?>
								<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php meta('NLSection7Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<? } ?>
                        </div>
                        <div class="newsletterContent">
                        	<?php meta('NLSection7Content'); ?>
                        </div>
                        <div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>
					<?php } ?>
                    
                    <!-- NEWSLETTER SECTION 8 IF AVAILABLE -->
					<?php if ( get_post_meta($post->ID, 'NLSection8Title', true) ) { ?>
                        <h3 class="newsletterH3"><?php meta('NLSection8Title'); ?></h3>
                        <div class="newsletterImage">
                        	<?php if(get_post_meta($post->ID, "NLSection8Image", true)) { ?>
                        		<img src="<?php meta('NLSection8Image'); ?>" alt="<?php meta('NLSection8Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<?php } else { ?>
								<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php meta('NLSection8Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<? } ?>
                        </div>
                        <div class="newsletterContent">
                        	<?php meta('NLSection8Content'); ?>
                        </div>
                        <div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>
					<?php } ?>
                    
                    <!-- NEWSLETTER SECTION 9 IF AVAILABLE -->
					<?php if ( get_post_meta($post->ID, 'NLSection9Title', true) ) { ?>
                        <h3 class="newsletterH3"><?php meta('NLSection9Title'); ?></h3>
                        <div class="newsletterImage">
                        	<?php if(get_post_meta($post->ID, "NLSection9Image", true)) { ?>
                        		<img src="<?php meta('NLSection9Image'); ?>" alt="<?php meta('NLSection9Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<?php } else { ?>
								<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php meta('NLSection9Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<? } ?>
                        </div>
                        <div class="newsletterContent">
                        	<?php meta('NLSection9Content'); ?>
                        </div>
                        <div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>
					<?php } ?>
                    
                    <!-- NEWSLETTER SECTION 10 IF AVAILABLE -->
					<?php if ( get_post_meta($post->ID, 'NLSection10Title', true) ) { ?>
                        <h3 class="newsletterH3"><?php meta('NLSection10Title'); ?></h3>
                        <div class="newsletterImage">
                        	<?php if(get_post_meta($post->ID, "NLSection10Image", true)) { ?>
                        		<img src="<?php meta('NLSection10Image'); ?>" alt="<?php meta('NLSection10Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<?php } else { ?>
								<img src="http://www.sunmaxxsolar.com/images/pr-logo.jpg" alt="<?php meta('NLSection10Title'); ?>" style="width:200px;float:left;margin:0px;margin-right:20px;margin-bottom:10px;border:#cccccc 2px solid;" />
							<? } ?>
                        </div>
                        <div class="newsletterContent">
                        	<?php meta('NLSection10Content'); ?>
                        </div>
                        <div style="width:100%;height:0px;clear:both;margin-bottom:10px;"></div>
					<?php } ?>
                    
                    <!-- End Newsletter Content Section -->

			<?php } ?>
                    
					<?php the_content() ?>
                    
                    <!-- INCLUDE END OF PAGE CTA BLOCK IF THE PAGE HAS A CTA URL -->
                    <?php if(get_post_meta($post->ID, "ctaURL", true)){ include('inpagecta.php') ; } ?>
					
                    <?php include 'facebook-comments.php'; ?>
                    
				</div>
			</div><!-- .post -->

		</div><!-- #content -->
	</div><!-- #container -->

<?php include 'single-newsletter-sidebar.php' ; ?>
<?php include 'lp-footer.php' ; ?>